{% block sw_flow_affiliate_and_campaign_code_modal %}
<sw-modal
    class="sw-flow-affiliate-and-campaign-code-modal"
    :title="$tc('sw-flow.modals.affiliateAndCampaignCode.title')"
    :closable="false"
    @modal-close="onClose"
>
    {% block sw_flow_affiliate_and_campaign_code_modal_content %}
    <div class="sw-flow-affiliate-and-campaign-code-modal__content">
        {% block sw_flow_affiliate_and_campaign_code_modal_entity %}
        <sw-single-select
            v-model:value="entity"
            name="sw-field--entity"
            class="sw-flow-affiliate-and-campaign-code-modal__entity"
            required
            show-clearable-button
            :label="$tc('sw-flow.modals.affiliateAndCampaignCode.labelEntity')"
            :placeholder="$tc('sw-flow.modals.affiliateAndCampaignCode.placeholderEntity')"
            :error="entityError"
            :options="entityOptions"
        />
        {% endblock %}

        <sw-container
            columns="3fr 1fr"
            gap="16px"
        >
            {% block sw_flow_affiliate_and_campaign_code_modal_affiliate_code %}

            <mt-text-field
                v-model="affiliateCode.value"
                name="sw-field--affiliateCode-value"
                class="sw-flow-affiliate-and-campaign-code-modal__affiliate-code"
                :label="$tc('sw-flow.modals.affiliateAndCampaignCode.labelAffiliateCode')"
                :placeholder="$tc('sw-flow.modals.affiliateAndCampaignCode.placeholderAffiliateCode')"
            />
            {% endblock %}

            {% block sw_flow_affiliate_and_campaign_code_modal_affiliate_code_overwrite %}

            <mt-switch
                v-model="affiliateCode.upsert"
                name="sw-field--affiliateCode-upsert"
                class="sw-flow-affiliate-and-campaign-code-modal__affiliate-code-overwrite"
                :label="$tc('sw-flow.modals.affiliateAndCampaignCode.overwrite')"
            />
            {% endblock %}
        </sw-container>

        <sw-container
            columns="3fr 1fr"
            gap="16px"
        >
            {% block sw_flow_affiliate_and_campaign_code_modal_campaign_code %}

            <mt-text-field
                v-model="campaignCode.value"
                name="sw-field--campaignCode-value"
                class="sw-flow-affiliate-and-campaign-code-modal__campaign-code"
                :label="$tc('sw-flow.modals.affiliateAndCampaignCode.labelCampaignCode')"
                :placeholder="$tc('sw-flow.modals.affiliateAndCampaignCode.placeholderCampaignCode')"
            />
            {% endblock %}

            {% block sw_flow_affiliate_and_campaign_code_modal_campaign_code_overwrite %}

            <mt-switch
                v-model="campaignCode.upsert"
                name="sw-field--campaignCode-upsert"
                class="sw-flow-affiliate-and-campaign-code-modal__campaign-code-overwrite"
                :label="$tc('sw-flow.modals.affiliateAndCampaignCode.overwrite')"
            />
            {% endblock %}
        </sw-container>
    </div>
    {% endblock %}

    <template #modal-footer>
        {% block sw_flow_affiliate_and_campaign_code_modal_footer_cancel_button %}
        <mt-button
            class="sw-flow-affiliate-and-campaign-code-modal__cancel-button"
            size="small"
            variant="secondary"
            @click="onClose"
        >
            {{ $tc('global.default.cancel') }}
        </mt-button>
        {% endblock %}

        {% block sw_flow_affiliate_and_campaign_code_modal_footer_save_button %}
        <mt-button
            class="sw-flow-affiliate-and-campaign-code-modal__save-button"
            variant="primary"
            size="small"
            @click="onSave"
        >
            {{ sequence.id ? $tc('sw-flow.modals.buttonSaveAction') : $tc('sw-flow.modals.buttonAddAction') }}
        </mt-button>
        {% endblock %}
    </template>
</sw-modal>
{% endblock %}
